﻿@using Abp.Application.Services.Dto
@using Akso.Web.Areas.Mpa.Models.Common.Modals
@using Abp.Web.Mvc.Extensions
@using Akso.Authorization
@using Akso.Web.Navigation
@model Akso.Web.Areas.Mpa.Models.Roles.RoleListViewModel
@{
    ViewBag.CurrentPageName = PageNames.App.Common.Roles;
}
@section Styles
{
    @Html.IncludeStyle("~/Areas/Mpa/Views/Roles/Index.min.css")
}
@section Scripts
{
    @Html.IncludeScript("~/Areas/Mpa/Views/Common/_PermissionTree.js")
    @Html.IncludeScript("~/Areas/Mpa/Views/Roles/_CreateOrEditModal.js")
    @Html.IncludeScript("~/Areas/Mpa/Views/Roles/Index.js")
}
<div class="row margin-bottom-5">
    <div class="col-xs-6">
        <div class="page-head">
            <div class="page-title">
                <h1>
                    <span>@L("Roles")</span> <small>@L("RolesHeaderInfo")</small>
                </h1>
            </div>
        </div>
    </div>
    <div class="col-xs-6 text-right">
        @if (IsGranted(AppPermissions.Pages_Administration_Roles_Create))
        {
            <button id="CreateNewRoleButton" class="btn btn-primary blue"><i class="fa fa-plus"></i> @L("CreateNewRole")</button>
        }
    </div>
</div>

<div class="portlet light margin-bottom-0">
    <div class="portlet-title portlet-title-filter">
        <div class="inputs inputs-full-width">
            <div class="portlet-input">
                <form>
                    <div class="row">
                        <div class="col-xs-6">
                            @Html.DropDownList(
                                "PermissionSelectionCombobox", Model.Permissions.Select(i => i.ToSelectListItem()),
                                new
                                {
                                    @class = "form-control selectpicker",
                                    data_live_search = "true",
                                    data_none_selected_text = L("FilterByPermission"),
                                    id = "PermissionSelectionCombo"
                                })
                        </div>
                        <div class="col-xs-6">
                            <div class="form-group">
                                <button id="RefreshRolesButton" class="btn btn-default" style="display: block; width: 100%"><i class="fa fa-refresh"></i> @L("Refresh")</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="portlet-body">
        <div id="RolesTable"></div>
    </div>
</div>
